using Google.ProtocolBuffers;
using micromsg.Proto;
using System;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace micromsg
{
	[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
	public sealed class KeyBuffer : GeneratedMessageLite<KeyBuffer, KeyBuffer.Builder>
	{
		[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
		public sealed class Builder : GeneratedBuilderLite<KeyBuffer, KeyBuffer.Builder>
		{
			private bool resultIsReadOnly;
			private KeyBuffer result;
			protected override KeyBuffer.Builder ThisBuilder
			{
				get
				{
					return this;
				}
			}
			public override bool IsInitialized
			{
				get
				{
					return this.result.IsInitialized;
				}
			}
			protected override KeyBuffer MessageBeingBuilt
			{
				get
				{
					return this.PrepareBuilder();
				}
			}
			public override KeyBuffer DefaultInstanceForType
			{
				get
				{
					return KeyBuffer.DefaultInstance;
				}
			}
			public SKBuiltinString_t Synckey
			{
				get
				{
					return this.result.Synckey;
				}
				set
				{
					this.SetSynckey(value);
				}
			}
			public Builder()
			{
				this.result = KeyBuffer.DefaultInstance;
				this.resultIsReadOnly = true;
			}
			internal Builder(KeyBuffer cloneFrom)
			{
				this.result = cloneFrom;
				this.resultIsReadOnly = true;
			}
			private KeyBuffer PrepareBuilder()
			{
				if (this.resultIsReadOnly)
				{
					KeyBuffer other = this.result;
					this.result = new KeyBuffer();
					this.resultIsReadOnly = false;
					this.MergeFrom(other);
				}
				return this.result;
			}
			public override KeyBuffer.Builder Clear()
			{
				this.result = KeyBuffer.DefaultInstance;
				this.resultIsReadOnly = true;
				return this;
			}
			public override KeyBuffer.Builder Clone()
			{
				if (this.resultIsReadOnly)
				{
					return new KeyBuffer.Builder(this.result);
				}
				return new KeyBuffer.Builder().MergeFrom(this.result);
			}
			public override KeyBuffer BuildPartial()
			{
				if (this.resultIsReadOnly)
				{
					return this.result;
				}
				this.resultIsReadOnly = true;
				return this.result.MakeReadOnly();
			}
			public override KeyBuffer.Builder MergeFrom(IMessageLite other)
			{
				if (other is KeyBuffer)
				{
					return this.MergeFrom((KeyBuffer)other);
				}
				base.MergeFrom(other);
				return this;
			}
			public override KeyBuffer.Builder MergeFrom(KeyBuffer other)
			{
				return this;
			}
			public override KeyBuffer.Builder MergeFrom(ICodedInputStream input)
			{
				return this.MergeFrom(input, ExtensionRegistry.Empty);
			}
			public override KeyBuffer.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
			{
				this.PrepareBuilder();
				uint num;
				string text;
				while (input.ReadTag(out num, out text))
				{
					if (num == 0u && text != null)
					{
						int num2 = Array.BinarySearch<string>(KeyBuffer._keyBufferFieldNames, text, StringComparer.get_Ordinal());
						if (num2 < 0)
						{
							this.ParseUnknownField(input, extensionRegistry, num, text);
							continue;
						}
						num = KeyBuffer._keyBufferFieldTags[num2];
					}
					uint num3 = num;
					if (num3 == 0u)
					{
						throw InvalidProtocolBufferException.InvalidTag();
					}
					if (num3 != 10u)
					{
						if (WireFormat.IsEndGroupTag(num))
						{
							return this;
						}
						this.ParseUnknownField(input, extensionRegistry, num, text);
					}
					else
					{
						SKBuiltinString_t.Builder builder = SKBuiltinString_t.CreateBuilder();
						if (this.result.hasSynckey)
						{
							builder.MergeFrom(this.Synckey);
						}
						input.ReadMessage(builder, extensionRegistry);
						this.Synckey = builder.BuildPartial();
					}
				}
				return this;
			}
			public KeyBuffer.Builder SetSynckey(SKBuiltinString_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasSynckey = true;
				this.result.synckey_ = value;
				return this;
			}
			public KeyBuffer.Builder SetSynckey(SKBuiltinString_t.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.hasSynckey = true;
				this.result.synckey_ = builderForValue.Build();
				return this;
			}
			public KeyBuffer.Builder MergeSynckey(SKBuiltinString_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				if (this.result.hasSynckey && this.result.synckey_ != SKBuiltinString_t.DefaultInstance)
				{
					this.result.synckey_ = SKBuiltinString_t.CreateBuilder(this.result.synckey_).MergeFrom(value).BuildPartial();
				}
				else
				{
					this.result.synckey_ = value;
				}
				this.result.hasSynckey = true;
				return this;
			}
			public KeyBuffer.Builder ClearSynckey()
			{
				this.PrepareBuilder();
				this.result.hasSynckey = false;
				this.result.synckey_ = null;
				return this;
			}
		}
		public const int SynckeyFieldNumber = 1;
		private static readonly KeyBuffer defaultInstance;
		private static readonly string[] _keyBufferFieldNames;
		private static readonly uint[] _keyBufferFieldTags;
		private bool hasSynckey;
		private SKBuiltinString_t synckey_;
		private int memoizedSerializedSize = -1;
		public static KeyBuffer DefaultInstance
		{
			get
			{
				return KeyBuffer.defaultInstance;
			}
		}
		public override KeyBuffer DefaultInstanceForType
		{
			get
			{
				return KeyBuffer.DefaultInstance;
			}
		}
		protected override KeyBuffer ThisMessage
		{
			get
			{
				return this;
			}
		}
		public SKBuiltinString_t Synckey
		{
			get
			{
				return this.synckey_ ?? SKBuiltinString_t.DefaultInstance;
			}
		}
		public override bool IsInitialized
		{
			get
			{
				return this.hasSynckey;
			}
		}
		public override int SerializedSize
		{
			get
			{
				int num = this.memoizedSerializedSize;
				if (num != -1)
				{
					return num;
				}
				num = 0;
				if (this.hasSynckey)
				{
					num += CodedOutputStream.ComputeMessageSize(1, this.Synckey);
				}
				this.memoizedSerializedSize = num;
				return num;
			}
		}
		private KeyBuffer()
		{
		}
		public override void WriteTo(ICodedOutputStream output)
		{
			int arg_06_0 = this.SerializedSize;
			string[] keyBufferFieldNames = KeyBuffer._keyBufferFieldNames;
			if (this.hasSynckey)
			{
				output.WriteMessage(1, keyBufferFieldNames[0], this.Synckey);
			}
		}
		public override int GetHashCode()
		{
			int num = base.GetType().GetHashCode();
			if (this.hasSynckey)
			{
				num ^= this.synckey_.GetHashCode();
			}
			return num;
		}
		public override bool Equals(object value)
		{
			KeyBuffer keyBuffer = value as KeyBuffer;
			return keyBuffer != null && (this.hasSynckey == keyBuffer.hasSynckey && (!this.hasSynckey || this.synckey_.Equals(keyBuffer.synckey_)));
		}
		public override void PrintTo(TextWriter writer)
		{
			GeneratedMessageLite<KeyBuffer, KeyBuffer.Builder>.PrintField("synckey", this.hasSynckey, this.synckey_, writer);
		}
		public static KeyBuffer ParseFrom(byte[] data)
		{
			return KeyBuffer.CreateBuilder().MergeFrom(data).BuildParsed();
		}
		private KeyBuffer MakeReadOnly()
		{
			return this;
		}
		public static KeyBuffer.Builder CreateBuilder()
		{
			return new KeyBuffer.Builder();
		}
		public override KeyBuffer.Builder ToBuilder()
		{
			return KeyBuffer.CreateBuilder(this);
		}
		public override KeyBuffer.Builder CreateBuilderForType()
		{
			return new KeyBuffer.Builder();
		}
		public static KeyBuffer.Builder CreateBuilder(KeyBuffer prototype)
		{
			return new KeyBuffer.Builder(prototype);
		}
		static KeyBuffer()
		{
			KeyBuffer.defaultInstance = new KeyBuffer().MakeReadOnly();
			KeyBuffer._keyBufferFieldNames = new string[]
			{
				"synckey"
			};
			KeyBuffer._keyBufferFieldTags = new uint[]
			{
				10u
			};
			object.ReferenceEquals(micromsg.Proto.KeyBuffer.Descriptor, null);
		}
	}
}
